package com.gzx.spring.apis.controller;

import com.gzx.risk.core.pojo.CommonResult;
import com.gzx.risk.core.tags.CommonLog;
import com.gzx.spring.apis.service.TanzhiService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "探知apis验证")
@RestController
@RequestMapping("/apis/tanzhi")
public class ApisTanzhiController {

    @Resource
    private TanzhiService tanzhiService;

    @Operation(summary = "global_risk")
    @CommonLog("global_risk")
    @PostMapping("/global_risk")
    public CommonResult<String> global_risk(@RequestParam(name = "name") String name, @RequestParam(name = "id") String id,
                                            @RequestParam(name = "phone") String phone) throws Exception {
        String result = tanzhiService.global_risk(name, id, phone);
        return CommonResult.ok(result);
    }

    @Operation(summary = "ty_d")
    @CommonLog("ty_d")
    @PostMapping("/ty_d")
    public CommonResult<String> ty_d(@RequestParam(name = "name") String name, @RequestParam(name = "id") String id,
                                     @RequestParam(name = "phone") String phone) throws Exception {
        String result = tanzhiService.ty_d(name, id, phone);
        return CommonResult.ok(result);
    }

    @Operation(summary = "ty_e")
    @CommonLog("ty_e")
    @PostMapping("/ty_e")
    public CommonResult<String> ty_e(@RequestParam(name = "name") String name, @RequestParam(name = "id") String id,
                                     @RequestParam(name = "phone") String phone) throws Exception {
        String result = tanzhiService.ty_e(name, id, phone);
        return CommonResult.ok(result);
    }
}
